package com.geor.gcv.core.process;

import org.opencv.core.Mat;
import org.opencv.imgproc.Imgproc;

/**
 * 轮廓提取
 * 
 * @author geor.lusongnan
 *
 */
public class CannyProcess extends Process {
	Process chain;
	int thresh;

	public CannyProcess(Process chain, int thresh) {
		this.chain = chain;
		this.thresh = thresh;
	}

	@Override
	public Mat process() {
		Mat mat = chain.process();
		Imgproc.Canny(mat, mat, thresh, thresh * 2, 3, false);
		return mat;
	}

	@Override
	public String getProcessName() {
		return chain.getProcessName() + "-->取轮廓处理";
	}
}
